package com.y.fund.web.aavo.mem;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class UserRoleVo {

    @Schema(title = "用户角色的分配记录ID")
	private String id;
	
    @Schema(title = "角色ID")
	private String roleId;

    @Schema(title = "角色名称")
	private String roleName;

    @Schema(title = "角色拥有者ID")
	private String ownerId;
	
    @Schema(title = "角色拥有者编号")
	private String ownerCode;

    @Schema(title = "角色拥有者名称")
	private String ownerName;

	public UserRoleVo() {
		super();
	}
	
	public UserRoleVo(String id, String roleId, String roleName, String ownerId, String ownerCode, String ownerName) {
		super();
		this.id = id;
		this.roleId = roleId;
		this.roleName = roleName;
		this.ownerId = ownerId;
		this.ownerCode = ownerCode;
		this.ownerName = ownerName;
	}

	
	public UserRoleVo(String id, String roleId, String roleName, String ownerId, String ownerName) {
		super();
		this.id = id;
		this.roleId = roleId;
		this.roleName = roleName;
		this.ownerId = ownerId;
		this.ownerName = ownerName;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((ownerCode == null) ? 0 : ownerCode.hashCode());
		result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode());
		result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserRoleVo other = (UserRoleVo) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (ownerCode == null) {
			if (other.ownerCode != null)
				return false;
		} else if (!ownerCode.equals(other.ownerCode))
			return false;
		if (ownerId == null) {
			if (other.ownerId != null)
				return false;
		} else if (!ownerId.equals(other.ownerId))
			return false;
		if (roleId == null) {
			if (other.roleId != null)
				return false;
		} else if (!roleId.equals(other.roleId))
			return false;
		return true;
	}
}
